package org.framework.common.api.query;

import java.io.Serializable;

import javax.persistence.criteria.Expression;
import javax.persistence.criteria.Root;

public class GroupBean implements Serializable {

	/** serialVersionUID(long):. */
	private static final long serialVersionUID = 7279837458933506687L;

	// 分组字段
	private String fieldName;
	
	public GroupBean() {
		
	}
	
	public GroupBean(String fieldName) {
		this.fieldName = fieldName;
	}
	
	/**
	 * 返回分组条件
	 * .
	 * @param root
	 * @return
	 * @author Administrator(zhaochong)
	 * @date 2016年4月30日 下午3:30:20
	 */
	public Expression<?> getExpresion(final Root<?> root){
		return root.get(fieldName);
	}

	public String getFieldName() {
		return fieldName;
	}

	public void setFieldName(String fieldName) {
		this.fieldName = fieldName;
	}
}
